<template>
  <div class="main">
    <div class="brand-introduce flex-between">
      <div class="left flex flex-align-items-center">
        <div class="left-info flex flex-align-items-center">
          <img :src="info.img">
          <div class="brand-txt">
            <div class="top flex flex-align-items-center">
              <p class="font-22-B">{{ info.name }}</p>
              <span v-for="(item, index) in info.tags" :key="index" class="font-12">{{ item }}</span>
            </div>
            <el-tooltip :content="info.desc" placement="top" effect="dark">
              <p class="bottom font-12 ellipsis-2">
                {{ info.desc }}</p>
            </el-tooltip>
          </div>
        </div>
        <el-tooltip content="关注" placement="top" effect="light">
          <div class="right-opt flex-center flex-align-items-center pointer">
            <i class="iconfont" :class="info.follow ? 'icon-31guanzhu1xuanzhong' : 'icon-guanzhu'"></i>
          </div>
        </el-tooltip>

      </div>
      <div class="right">
        <div class="date flex flex-align-items-center">
          <p class="font-14">收录日期</p>
          <span>|</span>
          <p class="font-14">数据更新日期</p>
        </div>
        <div class="time flex flex-align-items-center">
          <p class="font-16">{{ info.time }}</p>
          <span>|</span>
          <p class="font-16">{{ info.time }}</p>
        </div>
      </div>
    </div>

    <el-tabs v-model="tabCheck" class="tabs">
      <el-tab-pane label="品牌总览" name="品牌总览">
        <brand-overview></brand-overview>
      </el-tab-pane>
      <el-tab-pane label="YouTube" name="YouTube">
        <platform-overview type="1"></platform-overview>
      </el-tab-pane>
      <el-tab-pane label="TikTok" name="TikTok">
        <platform-overview type="2"></platform-overview>
      </el-tab-pane>
      <el-tab-pane label="Instagram" name="Instagram">
        <platform-overview type="3"></platform-overview>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script setup>
import BrandOverview from './components/brandOverview.vue';
import PlatformOverview from './components/platformOverview.vue';
import { ref } from 'vue';

const tabCheck = ref('YouTube');
const info = ref({
  name: 'xxxx',
  img: 'https://www.wotohub.com/static/img/koc_default_man.8132f247.svg',
  count: 1111111,
  tags: ['游戏', '数码'],
  desc: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  time: '2023-12-16'
});
</script>

<style lang="less" scoped>
.main {
  padding: 16px;

  &::v-deep {
    .el-tabs__header {
      padding-left: 22px;
    }

    .el-tabs__item {
      &:not(.is-active) {
        color: #666;

        &:hover {
          color: #666;
        }
      }

      &.is-active {
        color: #333;
        font-weight: bold;
      }
    }

    .el-tabs__nav-wrap::after {
      display: none;
    }

    .el-tabs__active-bar {
      height: 4px;
      background: @main-color;
    }
  }
}

.brand-introduce {
  .left {
    padding: 24px 32px 24px 24px;
    height: 130px;
    background: #fff;
    border-radius: 20px;
    flex: 1;

    .left-info {
      flex: 1;

      img {
        width: 80px;
        height: 80px;
        border-radius: 10px;
        margin-right: 16px;
      }

      .brand-txt {
        .top {
          p {
            color: #333;
            margin-right: 12px;
            max-width: 200px;
          }

          span {
            height: 24px;
            padding: 0 8px;
            background: hsla(0, 0%, 93%, .4);
            border-radius: 4px;
            border: 1px solid #dcdee0;
            color: #666;
            line-height: 22px;
            margin-right: 8px;
          }
        }

        .bottom {
          margin-top: 8px;
          color: #666;
          line-height: 17px;
        }
      }
    }

    .right-opt {
      width: 50px;
      height: 50px;
      background: #f9f9f9;
      border-radius: 14px;
      margin-right: 24px;
      margin-left: 40px;

      i {
        font-size: 32px;
        color: @main-color;
      }
    }
  }

  .right {
    padding: 24px 32px 24px 24px;
    width: 286px;
    height: 130px;
    background: #fff;
    border-radius: 20px;
    margin-left: 16px;

    .date,
    .time {
      &.date {
        margin-bottom: 34px;
      }

      p {
        color: #333;
      }

      span {
        color: #c1c1c1;
        margin: 0 6px;
      }
    }
  }
}

.tabs {
  padding-top: 24px;
}
</style>
